package com.kehutong.common.enums;

import org.coraframework.util.HashID;

/**
 * 公司模式类型
 * @author liuzhen (liuxing521a@163.com)
 * @createTime 2020年7月9日上午10:44:25
 */
public enum CropPattern implements HashID {

    THIRD("0", "第三方"),
    INNER("1", "内建");
    private final String id;
    private final String desc;

    private CropPattern(String id, String desc) {
        this.id = id;
        this.desc = desc;
    }

    @Override
    public String getId() {
        return id;
    }

    @Override
    public String getDesc() {
        return desc;
    }

    public static CropPattern getGenderById(String id) {
        CropPattern[] patterns = values();
        for (CropPattern pattern : patterns) {
            if (pattern.getId().equals(id)) {
                return pattern;
            }
        }
        return null;
    }
}
